local redis = require "resty.redis"
local cjson = require "cjson"
local red = redis:new()

red:set_timeout(1000) -- 1 sec
local ok, err = red:connect("127.0.0.1", 6379)
if not ok then 
    ngx.say(err)
    return
end


-- local taskid = red:rpop("dist-wrk-running-taskid-list")
-- ngx.say("taskid = ", taskid)

local r = red:lrange("dist-wrk-running-taskid-list", 0, -1)
ngx.say(cjson.encode(r))

if tonumber(taskid) then 
    ngx.say("number")
end